﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq.Expressions;
using Icms.Core.Model;

namespace Icms.Core.Repository
{
    public interface IUniRepo
    {
        void Insert<T>(T o) where T : class;
        void Save();
        T Get<T>(Guid id) where T : Entity;
    }

    public interface IRepo2<T> where T : class
    {
        IEnumerable<T> Where(Expression<Func<T, bool>> predicate);
        IEnumerable<T> GetAll();
    }

    public interface IDelRepo<T>
    {
        IEnumerable<T> Where(Expression<Func<T, bool>> predicate, bool showDeleted);
        IEnumerable<T> GetAll();
    }

    public interface IReportRepo
    {
        DataSet GetData(string name, IDictionary<string, object> parameters);
        IPageAbleResult<AssignmentHistory> GetAssignmentData(IDictionary<string, object> parameters);
        IEnumerable<CaseAssignmentHistory> GetCaseAssignmentData(IDictionary<string, object> parameters);
    }

    public interface IReadRepo<T>
    {
        T Get(Guid id);
    }

    public interface IConnectionFactory
    {
        string GetConnectionString();
    }

    public interface IDbContextFactory
    {
        DbContext GetContext();
    }

    public interface IDb2ContextFactory
    {
        DbContext GetContext();
    }

    public interface IDbrContextFactory
    {
        DbContext GetContext();
    }

    public interface IRepo<T>
    {
        T Get(Guid id);
        IEnumerable<T> GetAll();
        int Count();
        IEnumerable<T> Where(Expression<Func<T, bool>> predicate, bool showDeleted = false);
        void Insert(T o);
        void Save();
        void Delete(T o);
        void Delete(IEnumerable<T> oo);
        void Insert(IEnumerable<T> oo);
    }

    public interface IParameterRepo : IRepo<Parameter>
    {
       IEnumerable<Parameter> GetByCode(string code);
    }

    public interface ICaseRepo : IRepo<Case>
    {
        int GetMinNumberInYear(int year, Guid courtid);
    }

    
}